home *** CD-ROM | disk | FTP | other *** search
/ Aminet 7 / Aminet 7 - August 1995.iso / Aminet / text / hyper / ADtoHT2_1.lha / Source.lha / MyLib.lha / stdio / fgetc.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-03-04  |  387 b   |  30 lines

  1. #include <stdio.h>
  2. #include <errno.h>
  3.  
  4. #include <proto/dos.h>
  5.  
  6. /************************************************************************/
  7.  
  8. int fgetc(FILE *Stream)
  9.  
  10. {
  11.   long c;
  12.  
  13.   c=FGetC(Stream->Filehandle);
  14.   if (c==-1)
  15.     {
  16.       long Error;
  17.  
  18.       if ((Error=IoErr()))
  19.     {
  20.       errno=Error;
  21.       Stream->Flags.Error=1;
  22.     }
  23.       else
  24.     {
  25.       Stream->Flags.Eof=1;
  26.     }
  27.     }
  28.   return (int)c;
  29. }
  30.